Telegram Group & Telegram Channel
Использование комплексных чисел в Python

Никого здесь уже не удивить такими встроенными типами, как например int, float, и подобными. Но кроме них в Python существует еще один довольно интересный тип, а именно, complex.

В Python комплексные числа представлены в виде x + iy. А точнее говоря, вместо буквы i здесь используется буква j, во избежание некоторой путаницы, поскольку i чаще всего занята под циклы. Python преобразует реальные числа x и y (будь то int или float) в комплексное с помощью функции complex(x,y).

Комплексное число легко можно превратить в строку с помощью функции str или посчитать его модуль с помощью функции abs, а также для доступа к его реальной или мнимой частям можно воспользоваться методами real и imag.

Хотя complex и является встроенным типом, для более удобной работы с комплексными операциями рекомендуется импортировать модуль cmath.

#complex



tg-me.com/python_academy/578
Create:
Last Update:

Использование комплексных чисел в Python

Никого здесь уже не удивить такими встроенными типами, как например int, float, и подобными. Но кроме них в Python существует еще один довольно интересный тип, а именно, complex.

В Python комплексные числа представлены в виде x + iy. А точнее говоря, вместо буквы i здесь используется буква j, во избежание некоторой путаницы, поскольку i чаще всего занята под циклы. Python преобразует реальные числа x и y (будь то int или float) в комплексное с помощью функции complex(x,y).

Комплексное число легко можно превратить в строку с помощью функции str или посчитать его модуль с помощью функции abs, а также для доступа к его реальной или мнимой частям можно воспользоваться методами real и imag.

Хотя complex и является встроенным типом, для более удобной работы с комплексными операциями рекомендуется импортировать модуль cmath.

#complex

BY Python Academy




Share with your friend now:
tg-me.com/python_academy/578

View MORE
Open in Telegram


Python Academy Telegram | DID YOU KNOW?

Date: |

The SSE was the first modern stock exchange to open in China, with trading commencing in 1990. It has now grown to become the largest stock exchange in Asia and the third-largest in the world by market capitalization, which stood at RMB 50.6 trillion (US$7.8 trillion) as of September 2021. Stocks (both A-shares and B-shares), bonds, funds, and derivatives are traded on the exchange. The SEE has two trading boards, the Main Board and the Science and Technology Innovation Board, the latter more commonly known as the STAR Market. The Main Board mainly hosts large, well-established Chinese companies and lists both A-shares and B-shares.

Look for Channels Online

You guessed it – the internet is your friend. A good place to start looking for Telegram channels is Reddit. This is one of the biggest sites on the internet, with millions of communities, including those from Telegram.Then, you can search one of the many dedicated websites for Telegram channel searching. One of them is telegram-group.com. This website has many categories and a really simple user interface. Another great site is telegram channels.me. It has even more channels than the previous one, and an even better user experience.These are just some of the many available websites. You can look them up online if you’re not satisfied with these two. All of these sites list only public channels. If you want to join a private channel, you’ll have to ask one of its members to invite you.

Python Academy from ar


Telegram Python Academy
FROM USA